<!--
 * @FilePath: Edit.vue
 * @Author: 杜芬
 * @Date: 2025-04-26 19:10:17
 * @LastEditors:
 * @LastEditTime: 2025-04-26 19:11:14
 * Copyright: 2025 xxxTech CO.,LTD. All Rights Reserved.
 * @Descripttion: 页面
-->
<template>
  <!-- 编辑弹框 -->
  <el-dialog title="修改" :visible="editDialogVisible" width="45%" @close="editClose">
    <el-form ref="editFormRef" :inline="true" :model="formDate" label-width="100px" class="demo-ruleForm">
      <el-form-item label="准则层" prop="name">
        <el-input v-model="formDate.name" />
      </el-form-item>
      <el-form-item label="要素层" prop="date">
        <el-input v-model="formDate.date" />
      </el-form-item>
      <el-form-item label="指标层" prop="id">
        <el-input v-model="formDate.id" />
      </el-form-item>
      <el-form-item label="指标离散化" prop="id">
        <el-input v-model="formDate.id" />
      </el-form-item>
      <el-form-item label="指标权重(%)" prop="id">
        <el-input v-model="formDate.id" />
      </el-form-item>
    </el-form>
    <span slot="footer" class="dialog-footer">
      <el-button @click="editClose">取 消</el-button>
      <el-button type="primary" @click="editDialog">确 定</el-button>
    </span>
  </el-dialog>
</template>
<script>
export default {
  props: {
    editDialogVisible: {
      type: Boolean,
      default: false
    },
    editForm: {
      type: Object,
      default: () => {}
    }
  },
  data() {
    return {
      formDate: {}
    }
  },
  watch: {
    editForm(val) {
      this.formDate = {
        ...(val || {})
      }
    }
  },
  methods: {
    // 监听关闭表单的事件
    editClose() {
      this.$refs.editFormRef.resetFields()
      this.$emit('closeEdit') // 通知父组件关闭弹框
    },
    // 点击修改确定按钮
    editDialog() {
      console.log('点击修改确定按钮')
    }
  }
}
</script>
